/*************************************************************************
 *
 *  Copyright (C) 2013 Florian Dang <florian.coin@gmail.com>
 *
 *  This file is part of NatusVerse.
 *
 *  NatusVerse is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  NatusVerse is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with NatusVerse.  If not, see <http://www.gnu.org/licenses/>.
 *
 *************************************************************************/

#ifndef INC_RAYTRACER_OBJECTS_OBJECT_H_
#define INC_RAYTRACER_OBJECTS_OBJECT_H_

/*!
 * \file        object.h
 * \brief       Object
 * \author      Florian Dang
 * \date        2013
 */
 
#include "raytracer/objects/ray.h"
#include "raytracer/objects/material.h"

namespace raytracer
{
//! Abstract object class
/*!
  Object is a superclass for spheres, planes, cubes...
*/
class Object
{
	public:
		static const float kSmall;
		static const float kSmallShadow;
		static const float kSmallReflect;
		static const float kEpsilon;
		static const float kInfinite;

		//! object default constructor
		Object() {}

		//! object constructor given material
		Object(Material mat0)
			: material_(mat0) {}

		//! virtual object destructor
		virtual ~Object() {}

		// Object(const Object& object) : 
		// 	material_(object.material()) {}

		virtual Object* clone () const = 0;

		//! material accessor
		inline Material material() const { return material_; }

		//! virtual method for object intersection in space
		virtual bool Intersect(const Ray& ray, float& t) const = 0;

		//! virtual method for Normal vector
		virtual Vector Normal(const Point& intersection) const = 0;

		//! virtual method for printing object
		virtual void Print() const = 0;

		virtual void Move(float dx, float dy, float dz) = 0;

	protected:
		Material material_; /*!< material is protected for subclasses access */
};
}

#endif  // INC_RAYTRACER_OBJECTS_OBJECT_H_
